# Maintainer: Adrian Pop <adrian.pop@liu.se>

_realname=uasm
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=v2.50
pkgrel=1
pkgdesc="UASM is a free MASM-compatible assembler based on JWasm"
arch=('any')
license=('Watcom-1.0')
url="https://github.com/Terraspace/UASM"
depends=("${MINGW_PACKAGE_PREFIX}-gcc")
options=('strip')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
source=(https://github.com/Terraspace/UASM/archive/${pkgver}.tar.gz)
sha256sums=('2892af8f95bf3e1a8457a550018d9e9b7c07934190b73fb650301ae30074b796')

prepare() {
  cd ${srcdir}/UASM-2.50/
  rm -rf MinGWR
}

build() {
  cd ${srcdir}/UASM-2.50/
  make -f GccWin.mak
}

package() {
  install -Dm744 ${srcdir}/UASM-2.50/MinGWR/hjwasm.exe "${pkgdir}${MINGW_PREFIX}/bin/${_realname}.exe"
  install -Dm644 ${srcdir}/UASM-2.50/License.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
